package igz.fleaxy.util 
{
	
	/**
	 * ...
	 * @author Intelygenz | www.intelygenz.com
	 */
	public class ArrayUtil 
	{
		
		public function ArrayUtil()  {
			
		}

		static public function Delete(p_array:Array, p_index:int, p_range:int = 1 ):Array {
			if ( p_index > -1 ) {
				var tmp:Array = p_array.slice(0, p_index);
				return tmp.concat ( p_array.slice( p_index+p_range ) );				
			}
			else {
				return p_array;
			}
		}

		static public function Remove(p_array:Array, p_element:*, p_range:int = 1 ):Array {
			var idx:int = p_array.indexOf(p_element);
			return Delete(p_array, idx, p_range);
		}
		
	}
	
}